addProp(description, #downPrevCM, [#comment: "Down state of button: ", #format: #bitmap, #default: downdefault])
addProp(description, #upPrevCM, [#comment: "Up State of button: ", #format: #bitmap, #default: updefault])
addProp(description, #nextButtonSprite, [#comment: "What channel is Next Button: ", #format: #integer, #default: the currentSpriteNum + 1])
addProp(description, #totalCount, [#comment: "How many text fields: ", #format: #integer, #default: 1])
return description
end
on getBehaviorDescription
return "Send a Message to the designated Sprite when the specified Event occurs. At its destination the message will be interpreted as a sprite event and any actions defined for that event will be invoked." & RETURN & "PARAMETERS:" & RETURN & "ΓÇó Message - name of event to invoke at target sprite." & RETURN & "ΓÇó Target Sprite - number of sprite channel to which message should be sent." & RETURN & "ΓÇó Triggering Event - event that should cause message to be sent." & RETURN & "NOTES:" & RETURN & "If the target sprite does not handle the message it will propagate to the cast member script, the current frame script, and then the movie, in search of a handler for that event."
end
on getAssocMembers
set myPropList to [downPrevCM, upPrevCM]
return myPropList
end
on beginSprite me
set the disPrevNum of me to the member of sprite the spriteNum of me
set the disPrevCM of me to the member of sprite the spriteNum of me
set the upPrevNum of me to the number of member upPrevCM
set the downPrevNum of me to the number of member downPrevCM
set the disPrevNum of me to the number of member disPrevCM
set the button_active of me to 0
set the member of sprite the spriteNum of me to disPrevNum
set the currentCount of me to 1
end
on endSprite me
puppetSprite(the spriteNum of me, 0)
end
on triggerSendSprite me
trigger(me)
end
on checkbutton me
set currentCount to the currentCount of sprite(the TextSprite of me)
if currentCount = 1 then
set the member of sprite the spriteNum of me to disPrevNum
else
set the member of sprite the spriteNum of me to upPrevNum
end if
end
on mouseUp me
if the number of member the member of sprite the spriteNum of me = disPrevNum then
exit
end if
set the currentCount of me to the currentCount of me - 1
if the currentCount of me = 1 then
set the member of sprite the spriteNum of me to disPrevNum
else
set the member of sprite the spriteNum of me to upPrevNum
end if
set the button_active of me to 0
if whichevent = #mouseUp then
trigger(me)
end if
end
on mouseDown me
if the number of member the member of sprite the spriteNum of me = disPrevNum then
exit
end if
set the member of sprite the spriteNum of me to downPrevNum
set the button_active of me to 1
if whichevent = #mouseDown then
trigger(me)
end if
end
on mouseUpOutSide me
if the number of member the member of sprite the spriteNum of me = disPrevNum then
exit
end if
set the button_active of me to 0
end
on mouseLeave me
if the number of member the member of sprite the spriteNum of me = disPrevNum then
exit
end if
if the button_active of me then
set the member of sprite the spriteNum of me to upPrevNum
end if
end
on mouseEnter me
if the number of member the member of sprite the spriteNum of me = disPrevNum then
exit
end if
if the button_active of me then
set the member of sprite the spriteNum of me to downPrevNum